home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / datething / datething.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  3.6 KB  |  112 lines

  1. /*
  2.     File:        DateThing.h
  3.  
  4.     Contains:    
  5.  
  6.     Written by:     
  7.  
  8.     Copyright:    Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
  9.  
  10.                 You may incorporate this Apple sample source code into your program(s) without
  11.                 restriction. This Apple sample source code has been provided "AS IS" and the
  12.                 responsibility for its operation is yours. You are not permitted to redistribute
  13.                 this Apple sample source code as "Apple sample source code" after having made
  14.                 changes. If you're going to re-distribute the source, we require that you make
  15.                 it clear in the source that the code was descended from Apple sample source
  16.                 code, but that you've made changes.
  17.  
  18.     Change History (most recent first):
  19.                 7/19/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  20.                 
  21.  
  22. */
  23. #include <Types.h>
  24. #include <memory.h>
  25. #include <Packages.h>
  26. #include <Errors.h>
  27. #include <quickdraw.h>
  28. #include <fonts.h>
  29. #include <dialogs.h>
  30. #include <windows.h>
  31. #include <menus.h>
  32. #include <events.h>
  33. #include <OSEvents.h>
  34. #include <Desk.h>
  35. #include <diskinit.h>
  36. #include <OSUtils.h>
  37. #include <resources.h>
  38. #include <toolutils.h>
  39. #include <AppleEvents.h>
  40. #include <EPPC.h>
  41. #include <GestaltEqu.h>
  42. #include <PPCToolbox.h> 
  43. #include <Processes.h>
  44. #include <Balloons.h>
  45. #include <aliases.h>
  46.  
  47. typedef void (*myDrawProcPtr)(WindowPtr theWindow); 
  48. typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent); 
  49. typedef void (*windowSaveProc)(WindowPtr theWindow); 
  50. typedef void (*myCloseProcPtr)(WindowPtr theWindow); 
  51. typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how); 
  52. typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active); 
  53.  
  54. /* windowControl is the structure attached to every window I create (in the refCon */
  55. /* field) that contains all the information I need to know about the window. */
  56. /* data, procedure pointers for controlling, and anything else gets put in this */
  57. /* struct.  That makes my windows autonomous */
  58. struct windowControl {
  59.     unsigned long windowID;                                 /* master ID number  */
  60.     myDrawProcPtr drawMe;                                         /* content drawing procedure pointer */
  61.     myClickProcPtr clickMe;                                        /* content click routine */
  62.     myCloseProcPtr closeMe;                                        /* document close procedure pointer */
  63.     mySizeProcPtr sizeMe;                                            /* size procedure */
  64.     myActivateProcPtr activateMe;
  65.     AliasHandle fileAliasHandle;                            /* alias for this document */
  66.     Boolean windowDirty;
  67.     Handle generalData;                                        /* cast to whatever you need as you need it */
  68. };
  69. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  70.  
  71. struct AEinstalls {
  72.     AEEventClass theClass;
  73.     AEEventID theEvent;
  74.     AEEventHandlerProcPtr theProc;
  75. };
  76. typedef struct AEinstalls AEinstalls;
  77.  
  78. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  79. /* menu enums */
  80. enum {kMBarID = 128};
  81. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  82.  
  83. /* file menu enums */
  84. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  85.  
  86. /* general purpose enums */
  87. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
  88.  
  89. enum {kMinHeight = 200};
  90.  
  91. enum {kGeneralStrings = 128};
  92. enum {kblankstring1=1,kkblankstring2,kblankstring3,kblankstring4,kDadWords,kToWord};
  93.  
  94. enum {
  95.     kHomeKey = 1,
  96.     kEnterKey = 0x3,
  97.     kHelpKey = 5,
  98.     kDeleteKey = 8,
  99.     kTabKey = 9,
  100.     kPageUpKey = 0x0b,
  101.     kPageDownKey,
  102.     kReturnKey = 0x0d,
  103.     kEscKey = 0x1B,
  104.     kLeftArrowKey,
  105.     kRightArrowKey,
  106.     kUpArrowKey,
  107.     kDownArrowKey,
  108.     kSpaceKey,
  109.     kFDeleteKey = 0x7f 
  110.  
  111.     };
  112. enum {kDateDialog = 130};